import sys
import xml.dom.minidom

doc = xml.dom.minidom.parse(sys.stdin)

for node in doc.getElementsByTagName("node"):
   
   if node.getAttribute("status") == "alive":
      print "Device: " + node.getAttribute("address")
 
   for subnode in node.childNodes:
      if subnode.nodeName == "names":
	 #print subnode.childNodes
         for subsubnode in subnode.childNodes:
            if subsubnode.nodeValue is not "": 
               print " - Alias: "  + subsubnode.nodeValue


##for endpoint in doc.getElementsByTagName("endpoint"):
##   endpoint.normalize()
##   print "Protocol: " + endpoint.getAttribute("protocol")
##   print "Port: " + endpoint.getAttribute("port")
##   print "Status: " + endpoint.getAttribute("status")
